Skip to content

test(design-code-proxy): streaming Content-Length regression test (#688) - #1074

Merged
dezren39 merged 1 commit into
mainfrom
queue/1228-688-streaming-content-length
Oct 27, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/1228-688-streaming-content-length

Conversation

@dezren39

@dezren39 dezren39 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Fixes #688 · Queue task 1228 (follow-up to triage task 1067)

Gap

The streaming half of PR #685's Content-Length fix had no regression test: the test stub never set a Content-Length on SSE responses (and ok-length was gated to non-stream requests), so reverting writeHead's streaming delete headers['content-length'] failed nothing — proven by ablation in triage 1067 (suite stayed 6/6; the non-stream control ablation failed exactly the #684 test).

Change (test file only)

  • Stub gains an ok-length-stream mode: the SSE payload is served with a Content-Length equal to the backend's own byte count — stale the moment the proxy rewrites the model in each chunk, exactly the production hazard.
  • New test backend Content-Length does not truncate the model-rewritten SSE stream (#688): asserts the client receives the full rewritten stream including data: [DONE], and that any advertised Content-Length equals the bytes actually sent.

Verification

  • node --test bin/design-code-proxy.test.mjs: 7/7 pass on current code.
  • Ablation: with the streaming delete removed from bin/design-code-proxy.mjs, exactly the new test fails (6 pass / 1 fail); restored, 7/7 again.
  • No proxy behaviour change.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…#688)

The streaming half of #685's Content-Length fix had no regression
test: the stub never set Content-Length on SSE responses, so ablating
writeHead's streaming delete failed nothing (triage task 1067).

- Stub gains an 'ok-length-stream' mode: the SSE payload is served
  with a Content-Length equal to the backend's own byte count, which
  the proxy's per-chunk model rewrite makes stale.
- New test asserts the client receives the full rewritten stream
  (incl. [DONE]) and that any advertised Content-Length matches the
  bytes actually sent.

Verified: suite 7/7 on current code; with the streaming delete
ablated, exactly the new test fails (6 pass / 1 fail). Test-only —
no proxy change.
@dezren39
dezren39 requested a review from a team as a code owner October 27, 2026 03:07
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d1c97fb-9469-4b8d-b11b-ff435d792298
Commits

Reviewing files that changed from the base of the PR and between 1fdc882 and 676d9de.

Files selected for processing: 1
  • bin/design-code-proxy.test.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T03:09:07.037300Z 676d9de PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

design-code-proxy: the streaming half of PR #685's Content-Length fix has no regression test — the stub never sets Content-Length on SSE responses

1 participant